#ifndef TPSN_H
#define TPSN_H


// States
#define StartState 0
#define RootState 1
#define RootStateSendAck 2
#define BackOffState 3
#define ChildState 4
#define ChildStateSendSync 5
#define ChildStateSendAck 6

// Message Types
#define msg_LevelRequest 1
#define msg_AckLevelRequest 2
#define msg_LevelDisc 3
#define msg_Ack 4
#define msg_SyncPuls 5
#define msg_StartSync 6
#define msg_T2andT3info 7

// Timeouts
#define LevelDiscTimeout 2000
#define LevelDiscWaitTime 1500
#define TimeSyncWait 10000
#define WaitRandomTimeLow 0
#define WaitRandomTimeHigh 500
#define AckTimeOutLow 500
#define AckTimeOuthigh 1000
#define BackOffTimeLow 1000
#define BackOffTimeHigh 2000

#define TOSH_DATA_LENGTH 114
typedef nx_struct Package
{
	nx_int16_t messageType;
	nx_int16_t nodeLevel;
	nx_int32_t t2;
	nx_int32_t t3;
}Package;

typedef nx_struct radio_count_msg {
  nx_uint16_t counter;
} radio_count_msg_t;



#endif /* TPSN_H */
